package a09_贪心算法;

/**
 * <p>
 * a07_跳跃游戏复习1
 * </p>
 *
 * @author flyduck
 * @since 2025/1/10
 */
public class a07_跳跃游戏复习1 {
    //2,3,1,1,4
    public boolean canJump(int[] nums) {
        int cover = 0;
        for (int i = 0; i <= cover; i++) {
            cover = Math.max(cover, i + nums[i]);
            if(cover >= nums.length - 1){
                return true;
            }
        }
        return false;
    }
}
